package com.loanapp.base.common.exception;

/**
 * @Description 所有业务异常的枚举
 * @author fengshuonan
 * @date 2016年11月12日 下午5:04:51
 */
public enum BizExceptionEnum {


	/**
	 * 系统3类：成功 失败 登录失效
	 */

	/**
	 * 成功操作类
	 */
	SUCCESSFUL_OPERATION(000,"操作成功"),

	/**
	 * 异常问题描述
	 */
     SYSTEM_EEROR(111,"系统异常"),

	/**
	 * 返回错误描述
	 */
	REQUEST_PARAMS_NULL(111,"请求参数为空"),
	REQUEST_PARAMS_EEROR(111,"参数错误"),
	REQUEST_FAILED(111,"操作失败"),

	/**
	 *  微服务 调用
	 */
	SERVER_REQUEST_FAILED(111,"服务调用失败"),

	/**
	 * 登录及账户问题
	 */
	USER_ALREADY_REG(111,"该用户已经注册"),
	NO_THIS_USER(111,"没有此用户"),
	ACCOUNT_FREEZED(111, "账号被冻结"),
	OLD_PWD_NOT_RIGHT(111, "原密码不正确"),
	TWO_PWD_NOT_MATCH(111, "两次输入密码不一致"),
	LOGIN_OUT_TIME(111,"登录失效"),


	/**
	 * 文件上传
	 */
	FILE_READING_ERROR(111,"FILE_READING_ERROR!"),
	FILE_NOT_FOUND(111,"FILE_NOT_FOUND!"),
	UPLOAD_ERROR(111,"上传图片出错"),

	/**
	 * 权限和数据问题
	 */
	DB_RESOURCE_NULL(111,"数据库中没有该资源"),
	NO_PERMITION(111, "仅超级管理员可以操作"),
	REQUEST_INVALIDATE(111,"请求数据格式不正确"),
	INVALID_KAPTCHA(111,"验证码不正确"),
	CANT_DELETE_ADMIN(111,"不能删除超级管理员"),
	CANT_FREEZE_ADMIN(111,"不能冻结超级管理员"),
	CANT_CHANGE_ADMIN(111,"不能修改超级管理员角色"),

	/**
	 * 错误的请求
	 */
	DICT_MUST_BE_NUMBER(111,"字典的值必须为数字"),
	REQUEST_NULL(111, "请求有错误"),
	SESSION_TIMEOUT(111, "会话超时");

	BizExceptionEnum(int code, String message) {
		this.friendlyCode = code;
		this.friendlyMsg = message;
	}
	
	BizExceptionEnum(int code, String message,String urlPath) {
		this.friendlyCode = code;
		this.friendlyMsg = message;
		this.urlPath = urlPath;
	}

	private int friendlyCode;

	private String friendlyMsg;
	
	private String urlPath;

	public int getCode() {
		return friendlyCode;
	}

	public void setCode(int code) {
		this.friendlyCode = code;
	}

	public String getMessage() {
		return friendlyMsg;
	}

	public void setMessage(String message) {
		this.friendlyMsg = message;
	}

	public String getUrlPath() {
		return urlPath;
	}

	public void setUrlPath(String urlPath) {
		this.urlPath = urlPath;
	}

}
